package cn.fay.chapter18;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;

public class TransferTo {

	public static void main(String[] args) throws Exception {
		FileChannel in=new FileInputStream(new File("src/cn/fay/chapter18/Directory.java").getAbsoluteFile()).getChannel();
		FileChannel out=new FileOutputStream("out.txt").getChannel();
		in.transferTo(0, in.size(), out);
		//out.transferFrom(in, 0, in.size());
	}

}
